package com.myProject.order.service;

import com.myProject.order.dao.ProductCategoryDao;
import com.myProject.order.entity.ProductCategory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * Created by xhw on 2017/08/06.
 */

@Component
@Transactional
public class ProductCategoryService {

    @Autowired
    private ProductCategoryDao productCategoryDao;

    public ProductCategory findById(String id){
        return productCategoryDao.findOne(id);
    }

    public ProductCategory saveProduct(ProductCategory productCategory){
        return productCategoryDao.save(productCategory);
    }

    public List<ProductCategory> findList(){
        return productCategoryDao.findAll();
    }
}
